import 'package:flutter/foundation.dart';
import 'package:logger/logger.dart';

class XmmXLogcat {
  static final Logger _logger =
      Logger(printer: PrettyPrinter(), filter: XmmXLogFilter());

  static void d(dynamic message) {
    _logger.d(message);
  }

  static void i(dynamic message) {
    _logger.i(message);
  }

  static void w(dynamic message) {
    _logger.w(message);
  }

  static void e(dynamic message, [StackTrace? stackTrace]) {
    _logger.e(message, null, stackTrace);
  }
}

class XmmXLogFilter extends LogFilter {
  @override
  bool shouldLog(LogEvent event) {
    return kDebugMode;
  }
}
